//package com.liyue.myview.PopupWindow;
//
///**
// * Created by Ly
// * on 2021/7/23
// */
//import android.app.Activity;
//import android.content.Context;
//import android.graphics.Color;
//import android.graphics.drawable.ColorDrawable;
//import android.view.Gravity;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.PopupWindow;
//
//import androidx.viewpager.widget.ViewPager;
//
//
//import com.liyue.myview.PopupWindow.CommonPopupWindow;
//import com.liyue.myview.R;
//
//public class MSGPopWindow {
//
//
//    public static boolean isrunnable = false;
//    private static MSGPopWindow mInstance = null;
//    private final CommonPopupWindow commonPopupWindow;
//    private Context mContext;
//
//
//    private MSGPopWindow(Context c) {
//        this.mContext = c;
//   /*     //外部可点击：设置该属性钱先设置setBackgroundDrawable否则点击外部无法关闭
//        setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
//        setOutsideTouchable(true);
//        mPopView = LayoutInflater.from(c).inflate(R.layout.msg_layout, null);
//        setContentView(mPopView);
//        //设置窗口进入和退出的构造方法
////        setAnimationStyle(R.style.pop_animation);*/
//        commonPopupWindow = new CommonPopupWindow.Builder(c)
//                .setView(R.layout.msg_layout)
//                .setWidthAndHeight(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)
//                .setOutsideTouchable(true)
//                .create();
//    }
//
//    public static synchronized MSGPopWindow getmInstance(Context c) {
//        if (mInstance == null) {
//            mInstance = new MSGPopWindow(c);
//        }
//        return mInstance;
//    }
//
//    public void show() {
//        View view = (( Activity) mContext).getWindow().getDecorView();
//        commonPopupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);
//    }
//    public void show(View view) {
//
//        commonPopupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);
//    }
//
//
//    public void dismiss() {
//        isrunnable = false;
//        commonPopupWindow.dismiss();
//    }
//
//
//    public boolean onDismiss() {
//
//        return commonPopupWindow.isShowing();
//    }
//
//
//}
